<%@ page contentType="text/html;charset=utf-8" language="java" import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<jsp:useBean id="dbConnection" scope="session" class="DB.DBConnection"/>

<%	
	String user=(String)session.getAttribute("username");
	java.util.Date ntime=new java.util.Date();
	long nowtime=ntime.getTime();
	java.sql.Date nowdate=new java.sql.Date(nowtime);
	Calendar cal = Calendar.getInstance();
	SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  	String mDateTime=formatter.format(cal.getTime());
	String name=request.getParameter("textarea");
	name=new String(name.getBytes("ISO8859-1"),"utf-8");
	dbConnection.getConnection();
  	String into="INSERT INTO proclaim(content,admin,DateTime)VALUES('"+name+"','"+user+"','"+mDateTime+"')";
  	int rs=dbConnection.executeInsert(into);
  	dbConnection.closeConn();
%>
	<script>
	window.navigate("/209ChatRoom/admin.jsp");
	</script>